package com.linchong.source.aop;

import org.springframework.aop.AfterReturningAdvice;
import org.springframework.aop.MethodBeforeAdvice;

import java.lang.reflect.Method;

/**
 * @author linchong
 * @version 1.0
 * @Date: 2020-12-12 13:12
 * @Description: MyAdvice$
 */
public class MyAdvice implements MethodBeforeAdvice, AfterReturningAdvice {
	@Override
	public void afterReturning(Object o, Method method, Object[] objects, Object o1) throws Throwable {
		System.out.println("准备执行方法: " + method.getName());
	}

	@Override
	public void before(Method method, Object[] objects, Object o) throws Throwable {
		System.out.println(method.getName() + " 方法执行结束");
	}
}
